<?php

class HttpRequest extends CHttpRequest
{
    protected $route;

    public function getRoute()
    {
        if($this->route===null){
            $route=$this->requestUri;
            if(strpos($route,'?r=')){
                $tmpArr=explode('?r=',$route);
                $route=end($tmpArr);
            }
            if(strpos($route,'&')){
                $tmpArr=explode('&',$route);
                $route=array_shift($tmpArr);
            }
            if($route[0]=='/') $route=substr($route,1);
            $this->route=$route;
            unset($route);
        }
        return $this->route;
    }
} 